//
//  Singleton.h
//  hellomui
//
//  Created by zhangtao on 15/9/23.
//  Copyright © 2015年 zt.td. All rights reserved.
//

#ifndef Singleton_h
#define Singleton_h


//#endif /* Singleton_h */
#define singleton_Interface(class)  + (class *)share##class;

#define singleton_implemetntion(class)\
static class * instance = nil;\
+ (class *)share##class\
{\
if (!instance) {\
instance = [[class alloc]init];\
}\
return instance;\
}\
+ (class *)allocWithZone:(struct _NSZone *)zone\
{\
static dispatch_once_t onece;\
dispatch_once(&onece, ^{\
instance = [super allocWithZone:zone];\
});\
return instance;\
}